import 'package:flutter/material.dart';
import 'package:haokezufang/pages/home/index_recommand_item.dart';

import 'index_recommand_data.dart';

class IndexRecommand extends StatelessWidget {
  final List<IndexRecommendItem> dataList;

  const IndexRecommand({super.key, this.dataList = indexRecommendData});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(10),
      child: Column(
        children: [
          const Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [Text('房屋推荐'), Text('更多')],
          ),
          const Padding(padding: EdgeInsets.all(10)),
          Wrap(
            spacing: 10,
            runSpacing: 10,
            children:
                dataList.map((item) => IndexRecommandItem(data: item)).toList(),
          )
        ],
      ),
    );
  }
}
